{include file="public_head" /}
<!-- upload -->
<link href="__STATIC__/css/uploads.css" rel="stylesheet">
<!-- upload_arr -->
<link href="__STATIC__/plupload/plupload.css" rel="stylesheet">
<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">


<body class="nav-md">

<div class="container body">

    <div class="main_container">

        {include file="public_sidebar,public_nav" /}
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">

                <div class="page-title">
                    <div class="title_left">
                        <h3>促销活动管理</h3>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>{$mate_title}
                                    <!--<small>different form elements</small>-->
                                </h2>
                                <ul class="nav navbar-right panel_toolbox">
                                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                    </li>
                                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                                    </li>
                                </ul>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <br/>
                                <form class="form-horizontal form-label-left" enctype="multipart/form-data" action=""
                                      method="post" id="registerForm">

                                    <!--<div class="form-group">-->
                                        <!--<label class="control-label col-md-3 col-sm-3 col-xs-12">关联商品ID：</label>-->
                                        <!--<div class="col-md-6 col-sm-6 col-xs-12">-->
                                            <!--<input type="text" placeholder="请填写商品ID中间以（逗号,）分割"-->
                                                   <!--class="form-control col-md-7 col-xs-12" name="goods_id"-->
                                                   <!--maxlength="80"-->
                                                   <!--value="{$item.goods_id|default=''}"-->
                                            <!--&gt;-->
                                            <!--<div style="color: red">注：（只限于促销活动）请去商品列表查看ID <a href="{:url('console/ShopGoods/index',['orderId'=>'sort'])}" target="_blank">查看>></a> </div>-->
                                        <!--</div>-->
                                    <!--</div>-->

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">活动标题：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="请输入活动标题"
                                                   class="form-control col-md-7 col-xs-12" name="title"
                                                   value="{$item.title|default=''}"
                                                   datatype="*"
                                                   nullmsg="请输入活动标题！" errormsg="请输入活动标题！"
                                            >
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">活动图片上传：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <div id="imgdiv">
                                                <img id="imgShow" src="__PUBLIC__/{$item.picUrl|default=''}"
                                                     width="200" height="190"
                                                     onerror="this.src='__STATIC__/images/default.png'"/>
                                            </div>
                                            <div class="uploader white">
                                                <input type="text" class="filename" name="picUrl"
                                                       value="{$item.picUrl|default=''}" readonly/>
                                                <input type="button" name="file" class="button" value="上传..."/>
                                                <input type="file" id="up_img" name="picUrl"
                                                       value='{$item.picUrl|default=""}'/>
                                            </div>
                                        </div>
                                    </div>


                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">活动内容：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                           <textarea type="text/plain" style="height: 300px;" id="containers"
                                                     name="content"
                                                     placeholder="请输入信息内容">
                                                {$item.content|default=''}
                                            </textarea>
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <!--<div class="form-group">-->
                                        <!--<label class="control-label col-md-3 col-sm-3 col-xs-12">浏览次数：</label>-->
                                        <!--<div class="col-md-1 col-sm-6 col-xs-12">-->
                                            <!--<input type="text" placeholder="请填写排序"-->
                                                   <!--class="form-control col-md-7 col-xs-12" name="hit"-->
                                                   <!--value="{$item.hit|default='0'}"-->
                                            <!--&gt;-->
                                        <!--</div>-->
                                    <!--</div>-->

                                    <!--<div class="divider-dashed"></div>-->

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">排　　序：</label>
                                        <div class="col-md-1 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="请填写排序"
                                                   class="form-control col-md-7 col-xs-12" name="sort"
                                                   value="{$item.sort|default='0'}"
                                            >
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">启用状态：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <label class="radio_box">
                                                <input type="radio" name="status" id="status_1" class="cartradio"
                                                       value="1"
                                                       datatype="*"
                                                       nullmsg="请选择启用状态！" errormsg="请选择启用状态！"
                                                       {eq name='item.status|default=""' value='1' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="status_1"></label>
                                                <span>启用</span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="status" id="status_2" class="cartradio"
                                                       value="2"
                                                       datatype="*"
                                                       nullmsg="请选择启用状态！" errormsg="请选择启用状态！"
                                                       {eq name='item.status|default=""' value='2' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="status_2"></label>
                                                <span>禁用</span>
                                                &nbsp;&nbsp;
                                            </label>
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group" style="display: none;">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">发布时间：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            {empty name='item.create_time'}
                                            <input type="text" placeholder="请选择发布时间"
                                                   class="form-control col-md-7 col-xs-12" name="create_time"
                                                   value="{:date('Y-m-d H:i:s',time())}" onClick="WdatePicker()">
                                            {else /}
                                            <input type="text" placeholder="请选择发布时间" re
                                                   class="form-control col-md-7 col-xs-12" name="create_time"
                                                   value="{$item.create_time|date='Y-m-d H:i:s',###}"
                                                   onClick="WdatePicker()">
                                            {/empty}
                                        </div>
                                    </div>

                                    <div class="ln_solid"></div>

                                    <div class="form-group">
                                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                                            {present name="$item.id"}
                                            <input type="hidden" name="id" value="{$item.id}">
                                            {/present}
                                            <button type="submit" class="btn btn-primary">提交</button>
                                            <a type="reset" class="btn btn-success" onclick="history.go(-1)">返回</a>
                                        </div>
                                    </div>

                                </form>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
            <!-- /page content -->

        </div>

    </div>
</div>

{include file="public_foot" /}
<!-- upload_arr -->
<script src="__STATIC__/js/upload.photos.js"></script>
<script type="text/javascript" src="__STATIC__/plupload/plupload.full.min.js"></script>
<!-- Datatables-->
<script src="__STATIC__/js/datatables/jquery.dataTables.min.js"></script>
<script src="__STATIC__/js/datatables/dataTables.bootstrap.js"></script>
<!-- Times -->
<script src='__STATIC__/js/datepicker/WdatePicker.js'></script>
<!-- validform -->
<script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
<script src="__STATIC__/js/layer.js"></script>
<!-- select -->
<script src="__STATIC__/js/select/select2.full.min.js"></script>
<!-- upload -->
<script type="text/javascript" src="__STATIC__/js/uploadPreview.js"></script>
<!-- ueditor -->
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/lang/zh-cn/zh-cn.js"></script>
<script>
    // validform
    $(function () {

        $.Tipmsg.r = null;

        var showmsg = function (msg) {
            //假定你的信息提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
            alert(msg);
        }
        $("#registerForm").Validform({
            tiptype: function (msg) {
                layer.msg(msg);
            },
            tipSweep: true
        });

        // upload
        new uploadPreview({UpBtn: "up_img", DivShow: "imgdiv", ImgShow: "imgShow"});

        // select2
        $(".select2_single").select2({
            placeholder: "请选择分类",
            allowClear: true
        });

    })

    // 实例化编辑器
    var ue = UE.getEditor('containers');


</script>
</body>

</html>
